package com.qf.entity;

import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@Table(name = "leave")
public class Leave  implements Serializable {

	@Column(name = "pers_id")
	private Integer persId;

	@Column(name = "real_name")
	@NotBlank(message = "您的姓名必填")
	private String realName;

	@Column(name = "dept_id")
	@NotNull(message = "您的部门必填")
	private Integer deptId;

	@Column(name = "start_leave")
	@NotNull(message = "请假开始时间必填")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private java.util.Date startLeave;

	@Column(name = "end_leave")
	@NotNull(message = "请假结束时间必填")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private java.util.Date endLeave;

	@Column(name = "day_leave")
	@NotNull(message = "请假天数必填")
	private Integer dayLeave;

	@Column(name = "type_leave")
	@NotNull(message = "请假类型必填")
	private Integer typeLeave;

	@Column(name = "cause_leave")
	@NotBlank(message = "请假原因必填")
	private String causeLeave;

	@Column(name = "user_id")
	@NotNull(message = "审批人必填")
	private Integer userId;

	@Column(name = "audit_status")
	private Integer auditStatus;

	@Column(name = "audit_time")
	private java.util.Date auditTime;

	@Column(name = "task_id")
	private Integer taskId;

	@Transient
	private Integer status;

	@Transient
	private String deptName;

	@Transient
	private String leaveTypeName;

	@Transient
	private String name;

	@Transient
	private Date lastModifyTime;
}
